<?php 
namespace app\index\model;
use think\Model;
use traits\model\SoftDelete;

//user表的模型类
class User extends Model{



	//引用SoftDelete,软删除
	protected static $deleteTime = 'delete_time';

	//自动完成字段设置
	protected $auto = ['ip','password','update_time'];

	//protected $update = ['login_ip'];
	//自动获取IP
	protected function setIpAttr(){
		return request()->ip();
	}
	//自动MD5加密
	protected function setPasswordAttr($value){
		return md5($value);
	}


}


 ?>